/**
 * @file	simpleBLEperipheral.h
 * @author	chipsea
 * @brief	This file contains the Simple BLE Peripheral sample application
 *			definitions and prototypes.
 * @version 0.1
 * @date 2020-11-30
 * @copyright Copyright (c) 2020, CHIPSEA Co., Ltd.
 * @note
 */
#ifndef SIMPLEBLEPERIPHERAL_H
#define SIMPLEBLEPERIPHERAL_H

#ifdef __cplusplus
extern "C"
{
#endif

/*********************************************************************
 * INCLUDES
 */
#include "gapgattserver.h"

/*********************************************************************
 * CONSTANTS
 */
// Simple BLE Peripheral Task Events
#define SBP_START_DEVICE_EVT                           0x0001
#define SBP_PERIODIC_EVT                               0x0004
#define SBP_RESET_ADV_EVT                              0x0008
#define SBP_DISABLE_LATENCY_TEST_EVT                   0x0010
#define SBP_ENABLE_LATENCY_EVT                         0x0020
//#define SBP_DLE_CHANGE_EVT                             0x0020
//#define SBP_PHY_UPDATE_EVT                             0x0040
//#define SBP_CONN_NOTIFY_EVT                            0x0080
#define SBP_UPDATA_ADV_EVT                             0x0200

typedef enum
{
    TASK_ACTION_START = 0,
    TASK_ACTION_STOP
} task_action;

/*********************************************************************
 * MACROS
 */
extern uint8_t connect_status;
extern uint16_t gapConnHandle;
extern const uint8_t advertData[11];
extern const uint8_t scanRspData[3];
extern uint8_t attDeviceName[GAP_DEVICE_NAME_LEN];

/*********************************************************************
 * FUNCTIONS
 */

/**
 * @fn		void SimpleBLEPeripheral_Init( uint8 task_id )
 * @brief	Task Initialization for the BLE Application
 */
extern void SimpleBLEPeripheral_Init( uint8 task_id );

/**
 * @fn		uint16 SimpleBLEPeripheral_ProcessEvent( uint8 task_id, uint16 events )
 * @brief	Task Event Processor for the BLE Application
 */
extern uint16 SimpleBLEPeripheral_ProcessEvent( uint8 task_id, uint16 events );

/**
 * @fn		void ble_task_set(uint8 action, uint16 event, uint32 time)
 * @brief	
 * @param	none
 * @return	none
 */
void ble_task_set(uint8 action, uint16 event, uint32 time);

/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* SIMPLEBLEPERIPHERAL_H */
